package cn.jiaqiang.chatgpt.data.types.holder;


import javax.servlet.http.HttpServletRequest;

/**
 * @Author: jia-qiang ljq1024.cc
 * @desc:
 * @Date: 2024-05-09-15:18
 */
public class RequestHolder {
    private static final ThreadLocal<HttpServletRequest> tl = new ThreadLocal<>();

    public static void saveRequest(HttpServletRequest request){
        tl.set(request);
    }

    public static HttpServletRequest getRequest(){
        return tl.get();
    }

    public static void removeRequest(){
        tl.remove();
    }
}
